package file;

import java.io.File;
import java.io.FileFilter;
import java.util.Arrays;

public class Test3 {
    public static void main(String[] args) {
        File dir = new File(".");
//        FileFilter filter = file -> file.getName().contains("a");

        File[] subs = dir.listFiles(file -> file.getName().contains("a"));
        String str = Arrays.toString(subs);
        System.out.println(str);
        System.out.println("当前目录下子项有:"+subs.length);
    }
}
